package com.atguigu.controller;

import com.atguigu.client.OrderFeignClient;
import com.atguigu.entity.OrderInfo;
import com.atguigu.result.RetVal;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

import javax.servlet.http.HttpServletRequest;
import java.util.Map;

@Controller
public class WebOrderController {
    @Autowired
    private OrderFeignClient orderFeignClient;

    //1.页面跳转 确认订单
    @GetMapping("/confirm.html")
    public String confirm( Model model) {
        RetVal<Map<String, Object>> retVal = orderFeignClient.confirm();
        model.addAllAttributes(retVal.getData());
        return "order/confirm";
    }

    //2.页面跳转 确认订单
    @GetMapping("/myOrder.html")
    public String myOrder() {
        return "order/myOrder";
    }
}
